package db

const TableNameChamberMember = TablePrefix + "chamber_member"

type ChamberMember struct {
	BaseModel
	UID       uint   `gorm:"column:uid;type:int(11);default:0;comment:用户id" json:"uid" form:"uid"`                    // 用户id
	ChamberID uint   `gorm:"column:chamber_id;type:int(11);default:0;comment:商会id" json:"chamberID" form:"chamberID"` // 商会id
	PID       uint   `gorm:"column:pid;type:int(11);default:0;comment:商会id" json:"pid" form:"pid"`                    // 上级id
	LevelID   uint   `gorm:"column:level_id;type:int(11);default:0;comment:等级id" json:"levelID" form:"levelID"`       // 等级id
	WX        string `gorm:"column:wx;type:varchar(100);default:'';comment:微信联系方式" json:"wx" form:"wx"`               // 微信联系方式
	QQ        string `gorm:"column:qq;type:varchar(100);default:'';comment:qq联系方式" json:"qq" form:"qq"`               // qq联系方式
	Desc      string `gorm:"column:desc;type:varchar(255);comment:说明" json:"desc" form:"desc"`                        // 说明
}

func (*ChamberMember) TableName() string {
	return TableNameChamberMember
}

type ChamberMemberHasOneLevelAsUser struct {
	ChamberMember
	Conf ChamberConfig  `gorm:"foreignKey:ID;references:LevelID" json:"conf"`
	User UserHasOneRole `gorm:"foreignKey:ID;references:UID" json:"user"`
}

type ChamberMemberHasOneLevel struct {
	ChamberMember
	Conf ChamberConfig `gorm:"foreignKey:ID;references:LevelID" json:"conf"`
}
